import time

import requests
import execjs

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
    'Cookie': 'sessionid=替换为自己的sessionid'
}
params = {
    # 'page': '',
    'm': '',
    'q': ''
}
url = 'https://match.yuanrenxue.cn/api/match/6?page=%s'
js_code = open('jscode.js', 'r', encoding='utf-8').read()
js_com = execjs.compile(js_code)
q = ''
result = []
for i in range(1, 6):
    js_res = js_com.call('run', i)
    m = js_res['m']
    q = str(i) + '-' + str(js_res.get('t')) + "|"
    print(q)
    params['m'] = m
    params['q'] = q
    response = requests.get(url%i, headers=headers, params=params)
    json_data = response.json()
    print(json_data)
    result.extend([i['value'] for i in json_data.get('data')])
sum_ = sum(result)*24
print(sum_)